package com.gsta.cdn.cdr.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.gsta.cdn.cdr.entity.ServiceTypeRatings;
import com.gsta.cdn.cdr.mapper.ServiceTypeRatingsMapper;
import com.gsta.cdn.cdr.service.ServiceTypeRatingsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class ServiceTypeRatingsServiceImpl extends ServiceImpl<ServiceTypeRatingsMapper, ServiceTypeRatings> implements ServiceTypeRatingsService {

    @Override
    public List<Map<String, Object>> ServiceTypeCount(String date, int page, int pageSize) {
        page=(page-1)*pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCount(date,dbDate,page,pageSize);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountByArea(String date,String SP,String Area, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByArea(date,SP,Area,dbDate,page,pageSize);
    }

    @Override
    public int ServiceTypeCountByAreaTotal(String date, String SP, String Area) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByAreaTotal(date,SP,Area,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountAvgByArea(String date, String SP, String Area) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountAvgByArea(date,SP,Area,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeTotalByArea(String date, String SP, String Area) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeTotalByArea(date,SP,Area,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountByPopID(String date, String SP, String PopID, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByPopID(date,SP,PopID,dbDate,page,pageSize);
    }

    @Override
    public int ServiceTypeCountByPopIDTotal(String date, String SP, String PopID) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByPopIDTotal(date,SP,PopID,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountAvgByPopID(String date, String SP, String PopID) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountAvgByPopID(date,SP,PopID,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeTotalByPopID(String date, String SP, String PopID) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeTotalByPopID(date,SP,PopID,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountByPopName(String date, String PopName,String SP, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByPopName(date,PopName,SP,dbDate,page,pageSize);
    }

    @Override
    public int ServiceTypeCountByPopNameTotal(String date, String PopName, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountByPopNameTotal(date,PopName,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountAvgByPopName(String date, String PopName, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountAvgByPopName(date,PopName,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeTotalByPopName(String date, String PopName, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeTotalByPopName(date,PopName,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountPopNameGet(String date, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountPopNameGet(date,dbDate,page,pageSize);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountBySP(String date, String SP, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountBySP(date,SP,dbDate,page,pageSize);
    }

    @Override
    public int ServiceTypeCountBySPTotal(String date, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountBySPTotal(date,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeCountAvgBySP(String date, String SP, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeCountAvgBySP(date,SP,dbDate,page,pageSize);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeTotalBySP(String date, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeTotalBySP(date,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeArea(String date) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeArea(date,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeAreaSP(String date, String Area) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeAreaSP(date,Area,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeAreaPopName(String date, String Area, String SP) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeAreaPopName(date,Area,SP,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeByAreaAndPopName(String date, String Area, String SP, String PopName, int page, int pageSize) {
        page= (page-1) * pageSize;
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeByAreaAndPopName(date,Area,SP,PopName,dbDate,page,pageSize);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeAvgByAreaAndPopName(String date, String Area, String SP, String PopName) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeAvgByAreaAndPopName(date,Area,SP,PopName,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypeTotalByAreaAndPopName(String date, String Area, String SP, String PopName) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypeTotalByAreaAndPopName(date,Area,SP,PopName,dbDate);
    }


    @Override
    public List<Map<String, Object>> ServiceTypePopIDSP(String date, String PopID) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypePopIDSP(date,PopID,dbDate);
    }

    @Override
    public int countSum(String date) {
        String dbDate =date.substring(0,4);
        return baseMapper.countSum(date,dbDate);
    }

    @Override
    public List<Map<String, Object>> ServiceTypePopID(String date) {
        String dbDate =date.substring(0,4);
        return baseMapper.ServiceTypePopID(date,dbDate);
    }
}
